package cn.netswap.jeegorilla.framework.security.util;

import cn.netswap.jeegorilla.framework.security.bean.SmsValidCode;
import cn.netswap.jeegorilla.framework.security.util.interf.ISmsCodeGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * sms生成器  可被重新实现。
 * @author lgw
 * @version 1.0
 * @date 2020/3/20 10:16
 */
@Component
public class SmsGenerator implements ISmsCodeGenerator {

    @Autowired
    public GorillaValidCodeUtil gorillaValidCodeUtil;

    Logger log = LoggerFactory.getLogger(SmsGenerator.class);

    @Override
    public SmsValidCode smsGenerator() {
        SmsValidCode smsValidCode = gorillaValidCodeUtil.getValidCode();
        log.info("###########################  【"+smsValidCode.getCode()+"】  ###############################");
        return gorillaValidCodeUtil.getValidCode();
    }
}
